import { _decorator, Component, game, Label, Node } from 'cc';
import { UIManager } from '../../../../script/framework/manager/uiManager';
import ClientContext from '../../../../script/gameCore/global/ClientContext';
import { Constant } from '../../../../script/Enum/Enum';
import HallConfig from '../../../global/HallConfig';
import ClientManager from '../../../../script/gameCore/global/ClientManager';
const { ccclass, property } = _decorator;

@ccclass('hallPanel')
export class hallPanel extends Component {
    @property(Label)
    private lable_uid: Label = null;
    @property(Label)
    private lable_name: Label = null;
    @property(Label)
    private lable_version: Label = null;
    async show() {
        console.log('hallprefab show');
        const roleInfo = ClientContext.Instance.roleInfo;
        UIManager.instance.showTips("欢迎回家【昵称】UID:" + roleInfo.roleId, null, Constant.TIPS_ANI_NAME.tips2aniTop);
        this.lable_uid.string = this.lable_uid.string + roleInfo.roleId;
        this.lable_name.string = this.lable_name.string + roleInfo.name;
        this.lable_version.string = this.lable_version.string + HallConfig.HALL_VERSION;
    }

    /**
     * 大厅（hall）退出按钮触发功能
     */
    button_loginOut(eventTarget: any, customData: string){
        ClientManager.Instance.gameRestart(true);
    }
}

